-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: [yurthub] improve list/watch node pool resource in serviceTopology fil… #454
Conversation
/assign @rambohe-ch |
cmd/yurthub/app/config/config.go
Outdated
labelSelector = labelSelector.Add(*nodePoolLabel) | ||
yurtSharedInformerFactory := yurtinformers.NewSharedInformerFactoryWithOptions(yurtClient, 24*time.Hour, | ||
yurtinformers.WithTweakListOptions(func(options *metav1.ListOptions) { | ||
options.LabelSelector = labelSelector.String() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metadata.name
is field of object, so please use FieldSelector
instead LabelSelector
for metadata.name
, then the code like as following:
options.FieldSelector = fields.Set{"metadata.name": string(nodePoolName)}.String()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your help. I have already modified.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: neo502721, rambohe-ch The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…ter (#421)
What type of PR is this?
What this PR does / why we need it:
to improve list/watch node pool resource in serviceTopology filter
Which issue(s) this PR fixes:
Fixes #421
Special notes for your reviewer:
Does this PR introduce a user-facing change?
other Note
if user set the yurthub parameter "--nodepool-name". That will be add LabelSelector TweakListOptions to the nodepool-informer.